import 'package:demo_01/components/19_dio%E5%88%97%E8%A1%A8%E6%B8%B2%E6%9F%93.dart';
import 'package:flutter/material.dart';

class orderDetail extends StatelessWidget {
  orderDetail({super.key
  // , this.id
  });

  // 方式一：navigator传参
  // int? id;
  

  @override
  Widget build(BuildContext context) {
  // 方式二：pushedName传参
  final data = ModalRoute.of(context)?.settings.arguments as Map<String,int>;
  final id = data['id'];


    return MaterialApp(
      home: Scaffold(
          appBar: AppBar(
            title: Text('orderDetail'),
          ),
          body: ElevatedButton(
              child: const Text('back to the order'),
              onPressed: () {
                logger.i('返回了$id');
                // Navigate to second route when tapped.
                Navigator.pop(context);
              })),
    );
  }
}
